//
//  ASTextNode+Extension.swift
//  Social
//
//  Created by calm on 2019/6/19.
//  Copyright © 2019 shengsheng. All rights reserved.
//

import AsyncDisplayKit

extension ASTextNode {
    
    convenience init(_ text: String, color: UIColor, font: UIFont) {
        self.init()
        attributedText = text
            .colored(with: color)
            .applying([.font : font])
    }
    
    func set(_ text: String?, color: UIColor, font: UIFont) {
        attributedText = text?
            .colored(with: color)
            .applying([.font : font])
    }
}


extension ASTextNode2 {
    
    convenience init(_ text: String, color: UIColor, font: UIFont) {
        self.init()
        attributedText = text
            .colored(with: color)
            .applying([.font : font])
    }
    
    func set(_ text: String?, color: UIColor, font: UIFont) {
        attributedText = text?
            .colored(with: color)
            .applying([.font : font])
    }
}
